<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateActionLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('action_log', function (Blueprint $table) {
            $table->engine = 'InnoDB';

            $table->increments('id');
            $table->string('username', 50);
            $table->integer('user_id');
            $table->string('ip', 20);
            $table->string('ip_adress', 255);
            $table->integer('add_time');
            $table->string('realname', 30);
            $table->text('content');
            
            $table->index('user_id');
            $table->index('username');
            $table->index('add_time');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('action_log');
    }
}
